<article id="post-154" class="post-154 page type-page status-publish hentry">
   <div class="entry-content">
    <h1 class=" style="padding-bottom: 85px; padding-top: 0px;"">Account Details</h1> 
    <div class="clearfix">&nbsp;</div>
    <div id="account_Tab_Block" class="tabContainer">
      <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><?php /*?><a href="<?php echo $logout_url;?>" class="btn btn-sm btn-info pull-right" style="position:relative; margin-top:0px;">Log Out</a>&nbsp;&nbsp;<span class="pull-right" style="line-height:32px;">Welcome, <?php echo $name;?></span><?php */?></div>
      <div class="clearfix"></div>
      <div class="col-md-12 column">
        <div class="tabbable" id="tabs-290859">
          <ul class="nav nav-tabs">
            <li class="active"> <a href="#panel-AssignedProjectContainer" data-toggle="tab">
            <?php if($_SESSION['user_type'] == 'photographer' || $_SESSION['user_type'] == 'designer')
           				echo ' Assigned Projects';
				  else
				  		echo ' Order Status';
						?></a> </li>
        
             <?php if($user_type == 'customer')
					echo '   <li><a href="#PaymentDetails" role="tab" data-toggle="tab">Payment Details</a></li> ';
			?>		
             <li > <a href="#accountDetails" data-toggle="tab">Account Details</a> </li>
          </ul>
          <div class="tab-content">
            <div class="tab-pane active" id="panel-AssignedProjectContainer">
              <div class="row clearfix">
                <div class="col-md-12 column">
                  <form class="form-inline searchFilter" action=""  method="post" role="form">
                    <div class="form-group">
                    
                    <?php if($_SESSION['user_type'] == 'photographer' || $_SESSION['user_type'] == 'designer')
								$place_holder = 'Order ID / Name / Address';
						  else
						  		$place_holder = 'Order ID';
					?>
                      <input type="text" placeholder="<?php echo $place_holder;?>" style="min-width:400px;" name="search_filters" value="<?php echo $_POST['search_filters'];?>" class="form-control form">
                    </div>
                    <div class="form-group">
                    <?php $defalut_select = ($_POST['order_status'] ?  $_POST['order_status'] : 6 ); ?>
                      <select class="form-control" name="order_status">
                        <option value="6" selected="selected" >All Projects</option>
                        <?php echo $objTrack->getTrackSelect($defalut_select); ?>
                      </select>
                    </div>
                    <button type="submit" name="search_orders" class="btn btn-primary">Search</button>
                  </form>
                </div>
                <div class="clearfix"></div>
                <div class="col-md-12 column">
                  <div class="panel-group" id="panel-AssignedProject">
                          
                    <?php  
						 $count 	= 0;
						 $addon 	= ''; 
						 $addonnew  = '';
						 if(isset($_POST['search_orders'])){
							  if(($_POST['order_status']!=6))
								 $addon = 'AND wp_spec_order_trac.track_status = '.$_POST['order_status'].'';
				
							  if($_POST['search_filters']!=''){
								 $conditions =  $_POST['search_filters'];	   
								 $addonnew = 'AND (	wp_spec_assigned_orders.order_id = "'.$conditions.'"  OR (wp_usermeta.meta_value LIKE "%'.$conditions.'" AND( wp_usermeta.meta_key="first_name" OR wp_usermeta.meta_key="address")) )';
								}	
						 }
						
					
					
						 if($_SESSION['user_type'] == 'photographer' || $_SESSION['user_type'] == 'designer')	
						 		$where_condtn = " WHERE assigned_to = ".$user_id."";
						  else
						  		$where_condtn = " WHERE  wp_spec_checkout.user_id = ".$user_id."";
							
						  # PAGINATION
						  if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 
						  $start_from = ($page-1) * 20; 
						  
						  $query_pjcts = mysql_query("SELECT wp_spec_assigned_orders.order_id,
													 	     wp_spec_assigned_orders.time as assigned_time,
															 wp_spec_order_trac.track_status,
															 wp_spec_order_trac.photoshoot_time, 
															 wp_spec_checkout.user_id,
														  	 wp_spec_checkout.listing_add_id,
															 wp_spec_checkout.time as purchase_date,
															 wp_spec_checkout.package_ids,
															 wp_spec_listing_address.brokerage as listing_brokerage,
															 wp_spec_listing_address.agent_name as listing_agent_name, 
															 wp_spec_listing_address.agent_email as listing_agent_email,
															 wp_spec_listing_address.agent_phone as listing_agent_phone,
															 wp_spec_listing_address.property_address as listing_address,
															 wp_spec_listing_address.description as listing_description,
															 wp_spec_listing_address.unit_number as listing_unit_number,
															 wp_spec_listing_address.sq_footage as listing_sq_footage,
															 wp_spec_listing_address.bed_bath as listing_bed_bath,
															 wp_spec_listing_address.faces as listing_faces 
															 
													  FROM wp_spec_assigned_orders 
													  INNER JOIN wp_spec_order_trac 		ON wp_spec_assigned_orders.order_id = wp_spec_order_trac.order_id
													  INNER JOIN wp_spec_checkout   		ON wp_spec_assigned_orders.order_id = wp_spec_checkout.id
													  INNER JOIN wp_usermeta       			ON wp_spec_checkout.user_id         = wp_usermeta.user_id
													  INNER JOIN wp_spec_listing_address	ON wp_spec_checkout.listing_add_id  = wp_spec_listing_address.id 
													  ".$where_condtn."
													  AND 1=1 $addon  $addonnew 
													  GROUP BY concat(wp_usermeta.user_id,wp_spec_checkout.id) LIMIT $start_from, 20");
						  while ($row_pjcts = mysql_fetch_array($query_pjcts))
							{ 
							$count = 1;
							$customer_id = $row_pjcts['user_id'];
							# User DATA
							$user_info = get_userdata($customer_id);
							# USer Details
							$user_name 			 =  $user_info->first_name.' '.$user_info->last_name ;
							$user_address 		 = $user_info->address;
							$user_city 			 = $user_info->city;
							$user_state			 = $user_info->state;
							$user_zip			 = $user_info->zip;
							$user_add    		 = $user_address. ' '.$user_city. ' '.$user_state. ' '.$user_zip;
							$user_phone	         = $user_info->phone; 
							
							$package_ids  = $row_pjcts['package_ids'];
							$order_id     = $row_pjcts['order_id'];
							
							$unread_message_count = $objTrack->count_unread_message($order_id,$user_id);
							
						
							$purchase_date 		= date(' jS F Y',strtotime($row_pjcts['purchase_date']));
							$assigned_time 		= date(' jS F Y',strtotime($row_pjcts['assigned_time']));
							$photoshoot_time	= $row_pjcts['photoshoot_time'];
							# PROPERTY ADDRESS
						
							
							$listing_brokerage 		= $row_pjcts['listing_brokerage'];
							$listing_agent_name 	= $row_pjcts['listing_agent_name'];
							$listing_agent_email	= $row_pjcts['listing_agent_email'];
							$listing_agent_phone	= $row_pjcts['listing_agent_phone'];
							$listing_property_address = $row_pjcts['listing_address'];
							$listing_description 	= $row_pjcts['listing_description'];
							$listing_unit_number 	= $row_pjcts['listing_unit_number'];
							$listing_sq_footage 	= $row_pjcts['listing_sq_footage'];
							$listing_bed_bath 	    = $row_pjcts['listing_bed_bath'];
							$listing_faces 			= $row_pjcts['listing_faces']; 
							$listing_agent_name 	= $row_pjcts['listing_agent_name'];
						
							
							?>
                     <div class="panel panel-default">
                       <div class="panel-heading">
                         <div class="panel-title">
                           <label class="orderId">ORDER ID :</label>
                           <span class="orderIdNo"> #<?Php echo $order_id;?></span>
                           
                           <?php if($user_type=='customer')
								   echo '<div class="clearfix"></div>
												<label class="assignDate">Purchase  Date :'.$purchase_date.'</label>';
						  		else
									 echo '<div class="clearfix"></div>
											<label class="assignDate">Assigned Date :'.$assigned_time.'</label>';
										?>
                                        
                         </div>
                          
                         <div class="panel-address">
                          <label class="name"><?php echo $user_name;?> </label>
                           <div class="clearfix"></div>
                           <label class="details"><?php echo $listing_property_address; ?></label>
                         </div>
                       
                         <div class="pull-right btnRightBlock">
                          <button  class="collapsed btn btn-sm pull-right btnDown" id="data_tab<?php echo $order_id ?>" data-toggle="collapse" data-parent="#panel-AssignedProject" href="#panel-element-<?php echo $order_id;?>"></button>
                           &nbsp;&nbsp;
                           
                           <?php if($row_pjcts['track_status'] == 0)
						   			$button_status = 'warning';
								 else if ($row_pjcts['track_status'] == 1)	
								 	$button_status = 'info';
								 else if ($row_pjcts['track_status'] == 5)	
								    $button_status = 'success';
								 else 	
								 	$button_status = 'info';
									
							?>		
                           <button class="btn btn-md btn-<?php echo $button_status;?> pull-right statusInfo">Status : <?php echo $objTrack->getTrackStatus($row_pjcts['track_status']);?></button>
                            
                                

                           <a class="pull-right msgBlock" type="button" onclick="open_order_details('<?php echo $order_id;?>',<?php echo $user_id ;?>);">
                           
                           <?php if($unread_message_count>0) { ?>
                           <span id="clickme<?php echo $order_id;?>" onclick="open_order_details('<?php echo $order_id;?>',<?php echo $user_id ;?>);" class="badge"><?php echo  $unread_message_count;?></span>
                           <?php } ?>
                           </a>
                         </div>
                       </div>
                       <div id="panel-element-<?php echo $order_id;?>" class="panel-collapse collapse">
                         <div class="panel-body">
                           <div class="tabbable" id="tabs-191310">
                             <ul class="nav nav-tabs">
                               <li class="active"> <a href="#panel-tab<?php echo $order_id+1000;?>" data-toggle="tab">General Details</a> </li>
                               <li> <a href="#panel-tab<?php echo $order_id;?>" onclick="message_list_count_hide(<?php echo $order_id;?>)" id="message_tab<?Php echo $order_id;?>" data-toggle="tab" class="msg_tab_head">Project Tracking 
                               
                                <?php if($unread_message_count>0) { ?>
                               <span  id="message_list_count<?Php echo $order_id;?>" class="badge msg_tab_inside"><?php echo  $unread_message_count;?></span>
                               <?php } ?>
                               </a> </li>
                             </ul>
                             <div class="tab-content">
                               <div class="tab-pane active" id="panel-tab<?php echo $order_id+1000;?>">
                                 <div class="clearfix"></div>
                                 <div class="col-lg-3 col-md-3 col-sm-3 text-left">
                                   <h4><u>Property Address</u></h4>
                                     <p class=" text-left">
									 <?php echo $listing_property_address;?>
									 <?php /*?><strong>Harry D. Kay</strong><br/>
                                       <?php echo $user_add ;?><br /><?php */?>
                                       
<?php /*?>                                        <?php echo ($listing_brokerage ? 'Brokerage :<strong>'.$listing_brokerage.'</strong><br/>' : '')?>
                                        <?php echo ($listing_agent_name ? 'Agent name :<strong>'.$listing_agent_name.'</strong><br/>' : '')?>
                                        <?php echo ($listing_agent_email ? 'Agent email :<strong>'.$listing_agent_email.'</strong><br/>' : '')?> 
                                        <?php echo ($listing_agent_phone ? 'Agent phone :<strong>'.$listing_agent_phone.'</strong><br/>' : '')?>
                                        <?php echo ($listing_property_address ? 'Property address :<strong>'.$listing_property_address.'</strong><br/>' : '')?>
                                        <?php echo ($listing_description ? 'Other description  :<strong>'.$listing_description.'</strong><br/>' : '')?>
                                        <?php echo ($listing_unit_number ? 'Unit number :<strong>'.$listing_unit_number.'</strong><br/>' : '')?>
                                        <?php echo ($listing_sq_footage ? 'Sq footage :<strong>'.$listing_sq_footage.'</strong><br/>' : '')?>
                                        <?php echo ($listing_bed_bath ? '# of bed/bath :<strong>'.$listing_bed_bath.'</strong><br/>' : '')?>           
                                        <?php echo ($listing_faces ? 'Faces :<strong>'.$listing_faces.'</strong><br/>' : '')?>
                                      <?php */?>
                                      
                                     </p>
                                 </div>
                                 <div class="col-lg-6 col-md-6 col-sm-6 text-left borderLeft">
                                   <h4><u>Project Details</u></h4>
                                     <p class=" text-left"><span>Purchased Date :</span> <?php echo $purchase_date?> </p>
                                     <?php if($photoshoot_time!='') { ?>
                                     <p class="text-center alert alert-info"><span>Photo Shoot Sheduled Date :</span> <?php echo $photoshoot_time?> </p>
                                     <?php } ?>
                                     
                                     <p class=" text-left"><span>Notes and Requests :</span> <?php echo $listing_description?> </p> 
                                     <div class="clearfix"></div>
                                     <div class="col-lg-11 text-left">
                                     
                                        <?php if($_SESSION['user_type']=='photographer') {  ?>
                               	         <button  id="shedulePhotoShhotForm" data-toggle="modal" data-target="#shedulePhotoShhotForm_popup_<?Php echo $order_id;?>" class="btn btn-md btn-warning pull-left">Schedule Photoshoot</button> 
                                         
                                         <!-- POPUP FORM SHEDULE PHOTOSHOOT-->
                                          <div id="shedulePhotoShhotForm_popup_<?Php echo $order_id;?>"  class="modal fade bs-shedulePhotoShhotForm-modal-md"  tabindex="-1" role="dialog" aria-hidden="true">
				  <div class="modal-dialog modal-lg">
					<div class="modal-content">
					  <div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<h4 class="modal-title" style="font-weight:bold !important;">Shedule Photoshoot :- <label class="name_popup" style="color:#fff !important;"><?Php echo $user_name;?>, </label> <span class="address_popup"  style="color:#fff !important;"><?php echo $user_add;?></span></h4>
					  </div>
					  <form name="" method="post" action="">
					  <input type="hidden" value="<?php echo $_SESSION['user_ID'];?>" name="user_id">
                      <input type="hidden" value="<?php echo $order_id;?>" name="order_id" />
                      <input type="hidden" value="<?php echo $customer_id;?>" name="customer_id" />
					  <div class="modal-body">
						 <div class="form-horizontal">
								<ul class="form-group">
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-3 col-md-3 col-sm-3 col-xs-12">Order ID :</label>
										<span class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
										 # <?php echo $order_id  ?></span>
									</li> 
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-3 col-md-3 col-sm-3 col-xs-12">Work Status :</label>
										<span class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
										<select name="project_status" class="form-control"><option value="2">Photo Shoot Sheduled</option> </select></span>
									</li> 
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-3 col-md-3 col-sm-3 col-xs-12">Date and Time :</label>
										<span class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
										<input type="text" name="shoot_date_time" value="" class="form-control" ></span>
									</li> 
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-left">Message to customer :</label>
										<span class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
									<textarea  class="form-control"  style="min-height:200px;"  name="shootsheduled_message"></textarea></span>
									</li> 
									
									
								</ul>
						</div>
					  </div>
					  <div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
						<input type="submit" name="shedule_photoshoot" value="Schedule Photoshoot" class="btn btn-primary">
					  </div>
					  </form>
					</div><!-- /.modal-content -->
				  </div><!-- /.modal-dialog -->
</div>  
                               	         <button id="assignToDesigner" data-toggle="modal" data-target="#assignToDesigner_popup_<?Php echo $order_id;?>" class="btn btn-md btn-warning pull-right">Assign to Designer</button>
                                          <!-- Assign TO Designer  POPUP-->

										  <div id="assignToDesigner_popup_<?Php echo $order_id;?>"  class="modal fade bs-assignToDesigner-modal-md"  tabindex="-1" role="dialog" aria-hidden="true">
				  <div class="modal-dialog modal-lg">
					<div class="modal-content">
					  <div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<h4 class="modal-title" style="font-weight:bold !important;">Assign to Designer :- <label class="name_popup" style="color:#fff !important;"><?Php echo $user_name;?></label> <span class="address_popup" style="color:#fff !important;"><?php echo $user_add;?></span></h4>
					  </div>
					  <form name="" method="post" action="">
					  <input type="hidden" value="<?php echo $_SESSION['user_ID'];?>" name="user_id">
                        <input type="hidden" value="<?php echo $order_id;?>" name="order_id" />
					  <div class="modal-body">
						 <div class="form-horizontal">
								<ul class="form-group">
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-3 col-md-3 col-sm-3 col-xs-12">Order ID :</label>
										<span class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
										 # <?php echo $order_id  ?></span>
									</li> 
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-3 col-md-3 col-sm-3 col-xs-12">Choose Designer:</label>
										<span class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
										 <select name="assigned_designer" class="form-control">
                           			<option value="0">User List</option>
                                    <?php
									echo $objUser->listAllUsers($assigned_user,$order_id);
									?>
                  </select> </span>
									</li> 
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-3 col-md-3 col-sm-3 col-xs-12">Download Link:</label>
										<span class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
										<input type="text" name="download_link" value="" class="form-control" ></span>
									</li> 
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-left">Message To Designer :</label>
										<span class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
									<textarea  class="form-control"  style="min-height:200px;"  name="message_to_designer"></textarea></span>
									</li> 
									
									
								</ul>
						</div>
					  </div>
					  <div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
						<input type="submit" name="assign_to_designer" value="Assign to Designer" class="btn btn-primary">
					  </div>
					  </form>
					</div><!-- /.modal-content -->
				  </div><!-- /.modal-dialog -->
</div>  
   											
                                        <?php } ?>
                                        
                                        <?php if($_SESSION['user_type']=='designer') {  ?>
                                       <!-- <a href="#" class="btn btn-md btn-primary pull-left" target="_blank">Download Photos</a>-->
                                          <button id="markas_completed" data-toggle="modal" data-target="#markas_completed_popup_<?Php echo $order_id;?>" class="btn btn-md btn-warning pull-left">Mark as Completed</button>
                                          
                                          <div id="markas_completed_popup_<?Php echo $order_id;?>"  class="modal fade bs-assignToDesigner-modal-md"  tabindex="-1" role="dialog" aria-hidden="true">
				  <div class="modal-dialog modal-lg">
					<div class="modal-content">
					  <div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<h4 class="modal-title" style="font-weight:bold !important;">Mark as completed :- <label class="name_popup" style="color:#fff !important;" ><?Php echo $user_name;?></label> <span class="address_popup" style="color:#fff !important;"><?php echo $user_add;?></span></h4>
					  </div>
					  <form name="" method="post" action="">
					  <input type="hidden" value="<?php echo $_SESSION['user_ID'];?>" name="user_id">
                      <input type="hidden" value="<?php echo $customer_id;?>"  name="customer_id"/>
                        <input type="hidden" value="<?php echo $order_id;?>" name="order_id" />
					  <div class="modal-body">
						 <div class="form-horizontal">
								<ul class="form-group">
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-3 col-md-3 col-sm-3 col-xs-12">Order ID :</label>
										<span class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
										 # <?php echo $order_id  ?></span>
									</li> 
									
									
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-3 col-md-3 col-sm-3 col-xs-12">Download Link:</label>
										<span class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
										<input type="text" name="download_link" value="" class="form-control" ></span>
									</li> 
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-left">Message  :</label>
										<span class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
									<textarea  class="form-control"  style="min-height:200px;"  name="message_to_customer"></textarea></span>
									</li> 
									
									
								</ul>
						</div>
					  </div>
					  <div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
						<input type="submit" name="mark_as_completed" value="Mark as Completed" class="btn btn-primary">
					  </div>
					  </form>
					</div><!-- /.modal-content -->
				  </div><!-- /.modal-dialog -->
</div>
                                         <?php } ?>
                                        
                                            
                                         
                                     </div> 
                                     <div class="clearfix">&nbsp;</div>
                                 </div>
                                        
                                     <div class="clearfix">&nbsp;</div>
                                 <div class="table-responsive">
                                   <table class="table table-striped table-bordered tableOrder">
                                     <tr>
                                       <th class="col-lg-2 col-md-2 text-left">Package Name</th>
                                       <th class="col-lg-3 col-md-3 text-center">Description</th>
                                       <th class="col-lg-7 col-md-7 text-center">Terms</th>
                                     </tr>
                                            
                                     <?php $pkg_ids = explode("-", $package_ids);
													foreach($pkg_ids as $vals){
														$objPackage->getPackageDetails($vals);
														$package_name = $objPackage->name; 
														$description  = $objPackage->description; 
														$terms		  = $objPackage->terms; 	
														echo '  <tr>
																  <td class="col-lg-2 col-md-2 text-left">'.$package_name.'</td>
																  <td class="col-lg-3 col-md-3 text-center">'.$description .'</td>
																  <td class="col-lg-7 col-md-7 text-left">  <ul>'.$terms.'
																	</ul>
																 </td>
																</tr>';
														
														}?>
                                          
                                   </table>
                                 </div>
                                 <div class="clearfix"></div>
                               </div>
                               <div class="tab-pane" id="panel-tab<?php echo $order_id;?>">
                               
                          
                                 <?php if ($user_type=='customer') { ?>
                                  <button id="reply_to_message" data-toggle="modal" data-target="#reply_to_message_<?Php echo $order_id;?>" class="btn btn-md btn-warning pull-right">Reply</button>
                                  <?php } else { ?>
                                    <button id="reply_to_message" data-toggle="modal" data-target="#reply_to_message_<?Php echo $order_id;?>" class="btn btn-md btn-warning pull-right">Post Project Update</button>
                                  
                                  <?php }?>
                                          <!--Reply message  POPUP-->

										  <div id="reply_to_message_<?Php echo $order_id;?>"  class="modal fade bs-assignToDesigner-modal-md"  tabindex="-1" role="dialog" aria-hidden="true">
                                          <div class="modal-dialog modal-lg">
					<div class="modal-content">
					  <div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<h4 class="modal-title">Project Update </h4>
					  </div>
					  <form name="" method="post" action="">
					  <input type="hidden" value="<?php echo $_SESSION['user_ID'];?>" name="user_id">
                        <input type="hidden" value="<?php echo $order_id;?>" name="order_id" />
					  <div class="modal-body">
						 <div class="form-horizontal">
								<ul class="form-group">
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-3 col-md-3 col-sm-3 col-xs-12">Order ID :</label>
										<span class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
										 # <?php echo $order_id  ?></span>
									</li> 
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-3 col-md-3 col-sm-3 col-xs-12">Choose User:</label>
										<span class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
										 <select name="user_to_send_message" class="form-control">
                           			<option value="0">User List</option>
                                    <?php
									echo $objUser->listAllUsers($assigned_user,$order_id);
									
									?>
                                    <?php if($user_type!= 'customer') { ?>
                                    <option value="<?php echo $customer_id;?>"><?php echo $user_name;?></option>
                                    <?Php } ?>
                  </select> </span>
									</li> 
									
									
									
									<li class="col-lg-12 colmd-12 col-sm-12 col-xs-12">
										<label class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-left">Message :</label>
										<span class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
									<textarea  class="form-control"  style="min-height:200px;"  name="message_to_user"></textarea>
									</li> 
									
									
								</ul>
						</div>
					  </div>
					  <div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
						<input type="submit" name="send_message" value="Send Message" class="btn btn-primary">
					  </div>
					  </form>
					</div><!-- /.modal-content -->
				  </div></div>
                                 
                                 
                                 <table class="table table-striped table-bordered table-hover"> 
                                   <tbody>
                                     <tr>
                                         <th class="col-lg-2 col-md-2 text-left">Name</th>
                                         <th class="col-lg-8 col-md-8 text-center">Message</th>
                                         <th class="col-lg-2 col-md-2 text-center">Time</th>
                                        
                                     </tr>
                                     <?php 
										   $query_message = mysql_query("SELECT * FROM wp_spec_messages 
																		 WHERE track_id = ".$order_id." AND (
																		 send_to = ".$user_id." OR added_by	= ".$user_id." ) ORDER BY  `wp_spec_messages`.`time` DESC ");
										     while ($row_msg = mysql_fetch_array($query_message))
												{
												if($_SESSION['user_ID'] == $row_msg['added_by']){
													$msg_send_to = get_userdata($row_msg['send_to']);
													$sender_to 			 =  $msg_send_to->first_name.' '.$msg_send_to->last_name ;	
													$sender_name  = 'me<br>(Send To:'.$sender_to.')';
													
												}
												else{	
													$msg_send_by = get_userdata($row_msg['added_by']);
													$sender_name 			 =  $msg_send_by->first_name.' '.$msg_send_by->last_name ;	
												}
												echo ' <tr>
                                                <td class="col-lg-2 col-md-2 text-left">'.$sender_name.'</td>
                                                <td class="col-lg-8 col-md-8 text-left">'.$row_msg['message'].'</td>
                                                <td class="col-lg-2 col-md-2 text-left">'.date('g:ia \o\n l jS F Y',strtotime($row_msg['time'])).'</td>
                                            
                                            </tr>';
													}
							?>
                                            
                                           
                                         
                                            
                                   </tbody>
                                 </table>
                               </div>
                             </div>
                           </div>
                         </div>
                       </div>
                    </div>
                            
                            
                    <?Php
								
							}
						  if($count==0)
						   echo 'No records Found';
						   
						  # FOR PAGINATION 
						  $sql= mysql_query("SELECT wp_spec_assigned_orders.order_id,
													 	     wp_spec_assigned_orders.time as assigned_time,
															 wp_spec_order_trac.track_status,
															 wp_spec_checkout.user_id,
														  	 wp_spec_checkout.listing_add_id,
															 wp_spec_checkout.time as purchase_date,
															 wp_spec_checkout.package_ids,
															 wp_spec_listing_address.brokerage as listing_brokerage,
															 wp_spec_listing_address.agent_name as listing_agent_name, 
															 wp_spec_listing_address.agent_email as listing_agent_email,
															 wp_spec_listing_address.agent_phone as listing_agent_phone,
															 wp_spec_listing_address.property_address as listing_address,
															 wp_spec_listing_address.description as listing_description,
															 wp_spec_listing_address.unit_number as listing_unit_number,
															 wp_spec_listing_address.sq_footage as listing_sq_footage,
															 wp_spec_listing_address.bed_bath as listing_bed_bath,
															 wp_spec_listing_address.faces as listing_faces 
															 
													  FROM wp_spec_assigned_orders 
													  INNER JOIN wp_spec_order_trac 		ON wp_spec_assigned_orders.order_id = wp_spec_order_trac.order_id
													  INNER JOIN wp_spec_checkout   		ON wp_spec_assigned_orders.order_id = wp_spec_checkout.id
													  INNER JOIN wp_usermeta       			ON wp_spec_checkout.user_id         = wp_usermeta.user_id
													  INNER JOIN wp_spec_listing_address	ON wp_spec_checkout.listing_add_id  = wp_spec_listing_address.id 
													  ".$where_condtn."
													  AND 1=1 $addon  $addonnew 
													  GROUP BY concat(wp_usermeta.user_id,wp_spec_checkout.id)");
						    $total_records =  mysql_num_rows($sql);
							$total_pages = ceil($total_records / 5); 
							$pag_li = '';
							 
							for ($i=1; $i<=$total_pages; $i++) { 
							
								$params = array( 'page' => $i);
								$url = add_query_arg( $params,get_permalink().'/my-account' );	
								if($i == $page)
									$active = 'class="active"';
								$pag_li.= " <li ".$active."><a href='".$url."' >".$i."</a></li> "; 
							}; 
							
						  ?>
                          <nav>
                              <ul class="pagination">
                                <li class="disabled"><a href="#">&laquo;</a></li>
                               <!-- <li ><a href="#">1 <span class="sr-only">(current)</span></a></li>-->
                            <?php echo $pag_li;?>
                             </ul>
                            </nav>
                          
                           
                            
                            
                    <!--       
                            
                            
                            <div class="panel panel-default">
                              <div class="panel-heading"> 
                              <div class="panel-title">
                              	<label class="orderId">ORDER ID :</label><span class="orderIdNo"> #1017</span>
                                <div class="clearfix"></div>
                              	<label class="assignDate">Assigned Date : September 28, 2014</label> 
                              </div> 
                              <div class="panel-address">
                              	<label class="name">Mark A. Finney </label> 
                                <div class="clearfix"></div>
                              	<label class="details">3485 Hope Street, Salem, OR 97302</label> 
                              </div> 
                              <div class="pull-right btnRightBlock">
                              <button href="#panel-element-2" data-parent="#panel-AssignedProject" data-toggle="collapse" class="btn btn-sm pull-right btnDown open collapsed"></button> &nbsp;&nbsp;<button class="btn btn-md btn-info pull-right statusInfo">Status : Photographer Assigned</button> <a class="pull-right msgBlock" type="button">
                                <span class="badge"></span>
                                </a></div>
                              </div>
                              <div class="panel-collapse collapse" id="panel-element-2" style="height: 0px;">
                                <div class="panel-body">
                                
                                  <div id="tabs-191310" class="tabbable">
                                    <ul class="nav nav-tabs">
                                      <li class="active"> <a data-toggle="tab" href="#panel-tab21">Section 1</a> </li>
                                      <li> <a data-toggle="tab" href="#panel-tab22">Section 2</a> </li>
                                    </ul>
                                    
                                    <div class="tab-content">
                                      <div id="panel-tab21" class="tab-pane active">
                                       	
                     <div class="clearfix"></div>
                        <div class="table-responsive">
                            <table class="table table-striped table-bordered table-hover"> 
                             <tbody><tr>
                                    <th class="col-lg-2 col-md-2 text-left">Order ID</th>
                                    <th class="col-lg-8 col-md-8 text-center">Status</th>
                                    <th class="col-lg-2 col-md-2 text-center">Notes</th>
                                </tr>
                                <tr>
                                    <td class="col-lg-2 col-md-2 text-left">#2324343</td>
                                    <td class="col-lg-8 col-md-8 text-center">Pending</td>
                                    <td class="col-lg-2 col-md-2 text-left">We will be contacting you within 24 hours to schedule your photo shoot. </td>
                                </tr>
                                <tr>
                                    <td class="col-lg-2 col-md-2 text-left">#2324341</td>
                                    <td class="col-lg-8 col-md-8 text-center">Photographer Assigned</td>
                                    <td class="col-lg-2 col-md-2 text-left">We will be contacting you within 24 hours to schedule your photo shoot.</td>
                                </tr>
                                
                            </tbody></table>
                            
                        </div>
                        
                        <div class="clearfix"></div>
                                      </div>
                                      <div id="panel-tab22" class="tab-pane">
                                        <p> Howdy, I'm in Section 2. </p>
                                      </div>
                                    </div>
                                    
                                  </div>
                                </div>
                              </div>
                            </div>-->
                            
                            
                            
                            
                  </div>
                </div>
              </div>
            </div> 
                    
                    
                    
            <div class="tab-pane" id="accountDetails">
                  
              <div class="form-horizontal"><img id="editPropAddress" class="pull-right" src="<?php echo get_template_directory_uri();?>/images/edit_icon.png"  data-toggle="modal" data-target=".bs-editPropAddress-modal-md">
            	<ul class="form-group">
               	  <li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
               	    <label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">First Name :</label>
                    <span class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><?php echo $first_name;?></span>
                  </li> 
                    
               	  <li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
               	    <label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">Last Name :</label>
                    <span class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><?php echo $last_name	;?></span>
                  </li> 
                	
                    
               	  <li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
               	    <label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">Email :</label>
                    <span class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><?php echo $email;?></span>
                  </li> 
                    
                	 
               	  <li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
               	    <label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">Address :</label>
                    <span class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><?php echo $address;?></span>
                  </li> 
                    
               	  <li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
               	    <label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">State :</label>
                    <span class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><?php echo $state;?></span>
                  </li> 
                    
                	 
               	  <li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
               	    <label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">City:</label>
                    <span class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><?php echo $city;?></span>
                  </li> 
                    
               	  <li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
               	    <label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">Zip :</label>
                    <span class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><?php echo $zip;?></span>
                  </li>                     
                </ul>
            </div>
                  
            </div>
            
             
          <!-- PAYMENT -->  
            <div class="tab-pane" id="PaymentDetails">
                
                 <div class="clearfix"></div>
        <div class="table-responsive">
            <table class="table table-striped table-bordered table-hover"> 
            <tr>
                    <th class="col-lg-2 col-md-2 text-left">Order Id</th>
                    <th class="col-lg-2 col-md-2 text-center">Packages/services</th>
                    <th class="col-lg-2 col-md-2 text-center">Property Address</th>
                    <th class="col-lg-2 col-md-2 text-center">Price</th>
                    <th class="col-lg-2 col-md-2 text-center">Status</th>
                    <th class="col-lg-2 col-md-3 text-center">Time</th>
                   
                </tr><?php
				
              $query_payment = mysql_query("SELECT wp_spec_checkout.id,
										   		   wp_spec_checkout.package_ids,
												   wp_spec_checkout.total_amount,
												   wp_spec_checkout.payment_status,
												   wp_spec_checkout.time,
												   wp_spec_listing_address.property_address 
										   FROM wp_spec_checkout 
										   INNER JOIN wp_spec_listing_address ON  wp_spec_checkout.listing_add_id = wp_spec_listing_address.id
										   WHERE wp_spec_checkout.user_id=".$user_id."");
              while ($row = mysql_fetch_assoc($query_payment))
                {
					$package_name				 = '';
                    $payment_id       			 = $row['id'];
                    $package_id       			 = $row['package_ids'];
                    $total_amount	       		 = $row['total_amount'];
                    $payment_status       		 = $objPayment->getPaymentStatus($row['payment_status']);
                    $time       			 	 = $row['time'];
					$property_address			 = $row['property_address'];
					$pkg_ids = explode("-", $package_id);
					foreach($pkg_ids as $vals){
						$objPackage->getPackageDetails($vals);
						$package_name.= $objPackage->name.'<br>'; 
						}
    
                echo ' <tr>
                    <td class="col-lg-2 col-md-2 text-left">#'.$payment_id.'</td>
					<td class="col-lg-2 col-md-2 text-left">'.$package_name.'</td>
					<td class="col-lg-2 col-md-2 text-left">'.$property_address.'</td>
                    <td class="col-lg-2 col-md-2 text-center">$'.$total_amount.'.00</td>
                    <td class="col-lg-2 col-md-2 text-left">'.$payment_status.' </td>
                    <td class="col-lg-2 col-md-3 text-left">'.$time.' </td>
                    
                </tr>';
                }
				?>
     </table>
        </div>
        <div class="clearfix">&nbsp;</div>
            </div>
       <!-- PAYMENT -->  
    
                    
                    
          </div>
        </div> 
      </div>
    </div>
  </div>
 
</article>
<!-- #post --> 
        


  
<!-- #content --> 
  






<!-- POP UP FORM  ADDRESS-->
<div id="editPropAddress-modal"  class="modal fade  bs-editPropAddress-modal-md" tabindex="-1" role="dialog" aria-hidden="true">
				  <div class="modal-dialog">
					<div class="modal-content">
					  <div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<h4 class="modal-title">Edit Billing Address</h4>
					  </div>
					  <form name="" method="post" action="">
					  <input type="hidden" value="<?php echo $_SESSION['user_ID'];?>" name="user_id">
					  <div class="modal-body">
						 <div class="form-horizontal">
								<ul class="form-group">
									
									<li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
										<label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">First Name :</label>
										<span class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
										<input type="text" name="first_name" value="<?php echo $first_name ?>" class="form-control" ></span>
									</li> 
									
									<li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
										<label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">Last Name :</label>
										<span class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
										<input type="text" name="last_name" value="<?php echo $last_name ?>" class="form-control" ></span>
									</li> 
									
									<li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
										<label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">City :</label>
										<span class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
										<input type="text" name="city" value="<?php echo $city ?>" class="form-control" ></span>
									</li> 
									
									<li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
										<label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">State :</label>
										<span class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
										<input type="text" name="state" value="<?php echo $state ?>" class="form-control" ></span>
									</li> 
									<li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
										<label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">Zip :</label>
										<span class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
										<input type="text" name="zip" value="<?php echo $zip ?>" class="form-control" ></span>
									</li> 
									<li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
										<label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">Phone :</label>
										<span class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
										<input type="text" name="phone" value="<?php echo $phone ?>" class="form-control" ></span>
									</li> 
									<li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
										<label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">Email :</label>
										<span class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
										<input type="text" name="email" value="<?php echo $email;	 ?>" class="form-control" ></span>
									</li> 
									<li class="col-lg-6 colmd-6 col-sm-6 col-xs-12">
										<label class="col-lg-12 col-md-12 col-sm-12 col-xs-12">Address :</label>
										<span class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
										<textarea name="address" class="form-control" ><?php echo $address ?></textarea></span>
									</li>
								</ul>
						</div>
					  </div>
					  <div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
						<input type="submit" name="save_bill_address" value="Save changes" class="btn btn-primary">
					  </div>
					  </form>
					</div><!-- /.modal-content -->
				  </div><!-- /.modal-dialog -->
</div>
                
  <!-- POP UP FORM  Shedule Photo shoot-->              
 

          
                
                
                
                
                
                
<script language="javascript">
/*jQuery("#editPropAddress").click( function(){
		 $('#editPropAddress-modal').modal(options)
		} );	

jQuery("#shedulePhotoShhotForm").click( function(){
		 $('#shedulePhotoShhotForm-modal').modal(options)
		} );	

jQuery("#assignToDesigner").click( function(){
		 $('#assignToDesigner-modal').modal(options)
		} );*/
// With the element initially shown, we can hide it slowly:

function open_order_details(val,user){
	var openval  = "#data_tab"+val;
	var msg_count= "#clickme"+val;
	var msg_lst_count= "#message_list_count"+val;
	var msg_list = "#message_tab"+val;
	jQuery(openval).click();
	jQuery(msg_list).click();
	  jQuery(msg_count).hide( "slow", function() {
	  });
	   jQuery(msg_lst_count).hide( "slow", function() {
	  });
	   
	  var ajaxurl = ('<?php echo get_site_url();?>/wp-content/plugins/simple_cart_ordernow/ajax.php');
	   var data = {
			'user': user,
			'order_id': val
		};
		// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
		jQuery.post(ajaxurl, data, function(response) {
			//alert('Got this from the server: ' + response);
		});
	  
}

function message_list_count_hide(val){
	var msg_lst_count= "#message_list_count"+val;
	var msg_count= "#clickme"+val;
	 jQuery(msg_lst_count).hide( "slow", function() {
	  });
	 jQuery(msg_count).hide( "slow", function() {
	  }); 
	 
	}
	

</script>